<template>
  <div class="wrapper-header" style="display: flex">
    <div @click="goRouter('Home')" style="position: relative">
      <div class="logo-info">IRS开发者中心</div>
      <div class="paopao">beta</div>
    </div>
    <div class="top-menu-item" @click="goRouter('Hao123')">Hao123</div>
    <div class="top-menu-item" @click="goRouter('JsonFormat')">Json格式化</div>
    <div class="top-menu-item" @click="goRouter('MateRemote')">MateRemote</div>
  </div>
</template>

<script>
export default {
  name: 'HeaderBar',
  data() {
    return {};
  },
  methods: {
    goRouter(name) {
      if (this.$router.history.current.name !== name) {
        const routerObj = { name };
        this.$router.push(routerObj);
      }
    },
  },
};
</script>

<style scoped>
.logo-info {
  width: 200px;
  color: #ffffff;
  text-align: center;
  font-size: 16px;
  cursor: pointer;
}

.wrapper-header {
  width: 100%;
  height: 48px;
  line-height: 48px;

  top: 0;
  right: 0;
  z-index: 10;

  background-image: linear-gradient(143deg, #1d42ab, #2173dc, #1e93ff);
  background-color: #2b83f9;
}

.top-logo-item-2 {
  width: 200px;
  height: 48px;
  cursor: pointer;
}

.top-menu-item {
  color: rgba(255, 255, 255, 0.75);
  padding: 0 16px;
  font-size: 14px;
  cursor: pointer;
}

.top-menu-item:hover {
  background-color: #5bb6fd;
  color: #ffffff;
}

.paopao {
  color: #ffffff;
  line-height: 16px;
  height: 16px;
  border-radius: 8px;
  background-color: #ec343d;
  padding: 0 6px;
  position: absolute;
  transform: translateX(50%);
  transform-origin: -10% center;
  top: 14%;
  right: 15%;
  cursor: pointer;
}
</style>
